export function useUploadFile(path) {
  return new Promise((resolve, reject) => {
    uni.uploadFile({
      url: '/image',
      filePath: path,
      name: 'file',
      success: (uploadFileRes) => {
        console.log(uploadFileRes.data);
        resolve(import.meta.env.VITE_API_URL + '/image/' + JSON.parse(uploadFileRes.data)[0])
      },
      fail: (e) => {
        reject(e)
      }
    });
  })
}